<?php
/**
 *
 * @Author nikm $
 *
 * @Date 2012-3-9 $
 */

if(!defined('FROM_INDEX')) exit('Invalid request');

require ROOT_PATH.'servlet/function/sql.func.php';

class masterObj
{
	var $config = array();
	var $request = array();
	var $response = array();
	
	var $act = '';
	var $user = array();
	
	function __construct($request)
	{		
		$this->request = $request;
		$this->act = $request['a'];
		
		$this->request['limit'] = isset($request['count'])? min(50, max((int)$request['count'], 1)) : 10;
		$this->request['offset'] = isset($request['page']) ? max(0, (int)$request['page'] - 1) : 0;
		$this->request['offset'] *= $this->request['limit'];
	}
	
	function message($code, $status)
	{
		show_msg($this->request, $code, $status);
	}
	
	function showResponse()
	{
		show_response($this->request, $this->response);
	}

}